add = lambda x, y: x + y
print(add(1,2))

def my_len(iterable):
    if type(iterable) == int or type(iterable) == float or type(iterable) == complex:
        return f"数字型不能获取长度"
    if type(iterable) == bool:
        return f"布尔类型不能获取长度"
    count = 0
    for index in iterable:
        count += 1
    return count
print(my_len(12))
print(my_len(12.2))
print(my_len(12+2j))
print(my_len(False))
print(my_len("hello world"))
print(my_len([1,2,3,4,5]))
print(my_len((1,2,3,4,5)))
print(my_len({1,2,3,4,5}))
print(my_len({"1":1,"2":2,"3":3,"4":4}))

class user:
    def __init__(self,num,name,age,mobile,sex):
        """
        用户信息
        :param num:
        :param name:
        :param age:
        :param mobile:
        :param sex:
        """
        self.num = num
        self.name = name
        self.age = age
        self.mobile = mobile
        self.sex = sex
    def update(self,mobile):
        self.mobile = mobile
        print(f"{self.name}手机号修改为{self.mobile}")

    def show_user(self):
        print()

user = user(123,"xiaoming",18,15178831893,"1")
user.show_user()
user.update(15178831894)

class my_class_pub:
    def __init__(self):
        self.public_var = "public_var"

    def public_func(self):
        print(self.public_var)
        print("public_func")
my_class_pub = my_class_pub()
print(my_class_pub.public_var)
my_class_pub.public_func()

class my_class_private:
    def __init__(self):
        self.private_var = "private_var"
    def _private_func(self):
        print(self.private_var)

my_class_private = my_class_private()
print(my_class_private.private_var)
my_class_private.private_func()

